<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>
<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>
<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template name="noLongWords">
 <xsl:param name="text"/>
 <xsl:param name="limit"/>
 <xsl:choose>
   <xsl:when test="string-length(substring-before($text,' ')) &gt; 0 and string-length(substring-before(@title,' ')) &lt; $limit">
		<xsl:value-of select="substring-before($text,' ')"/>&#160;
		<xsl:call-template name="noLongWords">
			<xsl:with-param name="text" select="substring-after($text,' ')"/>
			<xsl:with-param name="limit" select="$limit"/>
		</xsl:call-template>   
	</xsl:when>
   <xsl:when test="(string-length(substring-before($text,' ')) = 0 and string-length($text) &gt; $limit ) or string-length(substring-before($text,' ')) &gt; $limit">
		<xsl:value-of select="substring($text,1,$limit)"/>...
	</xsl:when>
   <xsl:when test="string-length(substring-before($text,' ')) = 0 and string-length(substring-before(@title,' ')) &lt; $limit and string-length(substring-before($text,' ')) &lt; $limit">
		<xsl:value-of select="$text"/>
	</xsl:when>
 </xsl:choose>
</xsl:template>

<xsl:template match="lastBlogs">

<TABLE class="body" cellSpacing="0" cellPadding="0"  border="0" >
	<TBODY>
		<TR>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tl.gif" width="8" border="0"/></TD>
			<TD width="100%" background="/imgs/pvts/box-t-back.gif"  bgcolor="white"><IMG height="8" src="/imgs/pvts/box-t.gif" width="10" border="0"/></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tr.gif" width="8" border="0"/></TD>
		</TR>
		<TR vAlign="top">
			<TD width="8" background="/imgs/pvts/box-l-back.gif" bgcolor="white"><IMG height="10" src="/imgs/pvts/box-l.gif" width="8" border="0"/></TD>
			<TD width="100%" align="left" style="padding:2px;" bgcolor="white">

<div style="text-align:center; padding-bottom:10px;"><img src="/imgs/blog.yourlife.gif"/></div>
<xsl:for-each select="lastBlog">
		<div class="b10b" style="padding-top:4px;"><img src="/imgs/b.gif"/>&#160;<a href="/userinfo/blog.aspx?userid={@userid}">
		<xsl:call-template name="noLongWords">
			<xsl:with-param name="text" select="@title"/>
			<xsl:with-param name="limit" select="15"/>
		</xsl:call-template>
		</a></div>
</xsl:for-each>

			</TD>
			<TD width="8" background="/imgs/pvts/box-r.gif" bgcolor="white"><IMG height="10" src="/imgs/pvts/box-r.gif" width="8" border="0"/></TD>
		</TR>
		<TR>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-bl.gif" width="8" border="0"/></TD>
			<TD width="100%" background="/imgs/pvts/box-b.gif" bgcolor="white"><IMG height="8" src="/imgs/pvts/box-b.gif" width="10" border="0"/></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-br.gif" width="8" border="0"/></TD>
		</TR>
	</TBODY>
</TABLE>

</xsl:template>

</xsl:stylesheet>